package aybolit.core.objects.model;

import javax.persistence.*;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.Collection;

/**
 * Created by IntelliJ IDEA.
 * User: Vadim
 * Date: 29.03.13
 * Time: 16:54
 * To change this template use File | Settings | File Templates.
 */
@Entity
public class Healing implements Serializable {
    private int healingId;

    @javax.persistence.Column(name = "healing_id")
    @Id
    public int getHealingId() {
        return healingId;
    }

    public void setHealingId(int healingId) {
        this.healingId = healingId;
    }

    private int patientId;

    @javax.persistence.Column(name = "patient_id")
    @Basic
    public int getPatientId() {
        return patientId;
    }

    public void setPatientId(int patientId) {
        this.patientId = patientId;
    }

    private Timestamp timestamp;

    @javax.persistence.Column(name = "timestamp_")
    @Basic
    public Timestamp getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(Timestamp timestamp) {
        this.timestamp = timestamp;
    }

    private int statusId;

    @javax.persistence.Column(name = "status_id")
    @Basic
    public int getStatusId() {
        return statusId;
    }

    public void setStatusId(int statusId) {
        this.statusId = statusId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Healing healing = (Healing) o;

        if (healingId != healing.healingId) return false;
        if (patientId != healing.patientId) return false;
        if (statusId != healing.statusId) return false;
        if (timestamp != null ? !timestamp.equals(healing.timestamp) : healing.timestamp != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = healingId;
        result = 31 * result + patientId;
        result = 31 * result + (timestamp != null ? timestamp.hashCode() : 0);
        result = 31 * result + statusId;
        return result;
    }

    private Patientes patientesByPatientId;

    @ManyToOne
    public
    @javax.persistence.JoinColumn(name = "patient_id", referencedColumnName = "patient_id", table = "healing")
    Patientes getPatientesByPatientId() {
        return patientesByPatientId;
    }

    public void setPatientesByPatientId(Patientes patientesByPatientId) {
        this.patientesByPatientId = patientesByPatientId;
    }

    private Status statusByStatusId;

    @ManyToOne
    public
    @javax.persistence.JoinColumn(name = "status_id", referencedColumnName = "status_id", table = "healing")
    Status getStatusByStatusId() {
        return statusByStatusId;
    }

    public void setStatusByStatusId(Status statusByStatusId) {
        this.statusByStatusId = statusByStatusId;
    }

    private Collection<HealingAnalyzes> healingAnalyzesesByHealingId;

    @OneToMany(mappedBy = "healingByHealingId")
    public Collection<HealingAnalyzes> getHealingAnalyzesesByHealingId() {
        return healingAnalyzesesByHealingId;
    }

    public void setHealingAnalyzesesByHealingId(Collection<HealingAnalyzes> healingAnalyzesesByHealingId) {
        this.healingAnalyzesesByHealingId = healingAnalyzesesByHealingId;
    }

    private Collection<HealingDiagnosis> healingDiagnosisesByHealingId;

    @OneToMany(mappedBy = "healingByHealingId")
    public Collection<HealingDiagnosis> getHealingDiagnosisesByHealingId() {
        return healingDiagnosisesByHealingId;
    }

    public void setHealingDiagnosisesByHealingId(Collection<HealingDiagnosis> healingDiagnosisesByHealingId) {
        this.healingDiagnosisesByHealingId = healingDiagnosisesByHealingId;
    }

    private Collection<HealingDoctors> healingDoctorsesByHealingId;

    @OneToMany(mappedBy = "healingByHealingId")
    public Collection<HealingDoctors> getHealingDoctorsesByHealingId() {
        return healingDoctorsesByHealingId;
    }

    public void setHealingDoctorsesByHealingId(Collection<HealingDoctors> healingDoctorsesByHealingId) {
        this.healingDoctorsesByHealingId = healingDoctorsesByHealingId;
    }

    private Collection<HealingSymptoms> healingSymptomsesByHealingId;

    @OneToMany(mappedBy = "healingByHealingId")
    public Collection<HealingSymptoms> getHealingSymptomsesByHealingId() {
        return healingSymptomsesByHealingId;
    }

    public void setHealingSymptomsesByHealingId(Collection<HealingSymptoms> healingSymptomsesByHealingId) {
        this.healingSymptomsesByHealingId = healingSymptomsesByHealingId;
    }
}
